import { LayoutRouteType } from './types';

// 配置路由
export default {
  routes: <LayoutRouteType[]>[
    {
      path: '/',
      redirect: '/login',
    },
    {
      name: '登录',
      path: '/login',
      component: './Login',
      menuRender: false,
      footerRender: false,
      headerRender: false,
      hideInMenu: true,
      layout: false,
      access: 'noAuth',
    },
    {
      name: '工作台',
      path: '/dashboard',
      component: './Dashboard',
      icon: 'DashboardOutlined',
      access: 'canAdmin',
    },
    {
      name: '用户管理',
      path: '/user',
      component: './User',
      icon: 'UserOutlined',
      access: 'canAdmin',
    },
    {
      name: '库存管理',
      path: '/material',
      icon: 'AccountBookOutlined',
      access: 'noAuth',
      routes: [
        { path: '/material/', redirect: '/material/list' },
        { name: '库存列表', path: '/material/list', component: './Material', access: 'canAdmin' },
        {
          name: '库存分类',
          path: '/material/category',
          component: './Material/Category',
          access: 'canAdmin',
        },
        {
          name: '物资外借登记',
          path: '/material/borrow',
          component: './MaterialBorrow',
          access: 'noAuth',
        },
      ],
    },
    {
      name: '宿舍跳闸记录',
      path: '/dorm-tripping-record',
      icon: 'ThunderboltOutlined',
      component: './DormTrippingRecord',
      access: 'noAuth',
    },
    {
      name: '系统设置',
      path: '/system',
      icon: 'setting',
      access: 'canAdmin',
      // component: './OperationLog',
      // wrappers: ['@/wrappers/auth'],
      routes: [
        { path: '/system/', redirect: '/system/operate' },
        // { name: '账号管理', path: '/system/account', component: './Account' },
        // { name: '部门管理', path: '/system/dept', component: './Account' },
        // { name: '角色管理', path: '/system/role', component: './Account' },
        // { name: '菜单管理', path: '/system/menu', component: './Account' },
        {
          name: '登录日志',
          path: '/system/operate',
          component: './OperationLog',
          access: 'canAdmin',
        },
        {
          name: '操作日志',
          path: '/system/operation',
          component: './OperationLog/OperationLogPage',
          access: 'canAdmin',
        },
      ],
    },
  ],
};
